<?php
('Access-Control-Allow-Origin：*');
include("../config/mysql.php");
$limit = $_REQUEST['limit'];
$page = $_REQUEST['page'];
$company = $_REQUEST['company'];
$sql = "SELECT * FROM company WHERE companyName LIKE '%{$company}%' ORDER BY id ASC";
$Mysql = new Mysql();
$count = $Mysql->getResultNum($sql);
if ($limit && $page) {
    $start = ($page - 1) * $limit;
    $sql .= " limit {$start},{$limit}";
}
/*查询表格参数一表明   参数二 查询语句*/
$arr = $Mysql->likeSelectLayui($sql);
/*返回出去*/
if (is_array($arr) == 1) {
    $res = [
        'code' => 0,
        'msg' => '查询成功',
        'count' => $count,
        'data' => $arr
    ];
} else {
    $res = [
        'msg' => '没有查到数据',
    ];
}
echo json_encode($res, JSON_UNESCAPED_UNICODE);
/*关闭连接*/
$Mysql->close();
